package br.com.lojaweb.util;

import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.cfg.AnnotationConfiguration;

public class HibernateUtil {
    
private static SessionFactory factory;
   static {
     AnnotationConfiguration cfg = new AnnotationConfiguration();
     factory = cfg.configure("hibernate.cfg.xml").buildSessionFactory();
   }

   public Session getSession() {
    return factory.openSession();
   }
}
